package com.yc.sole.erp.request;

import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2024-01-24
 **/
@Data
public class MaterialReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 材料名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String name;
    /**
     * 单位
     */
    @Length(max = 10, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String unit;
    /**
     * 含税单价
     */
    @DecimalMin(value = "0.01", groups = {SaveGroup.class, UpdateGroup.class})
    @DecimalMax(value = "99999999", groups = {SaveGroup.class, UpdateGroup.class})
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private BigDecimal unitPrice;
    /**
     * 备注
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String remark;
}
